﻿using UnityEngine;
using System.Collections;

public enum WordType
{
    DAMAGE,
    MISS,
    ADD,
    IMMUNE,     // 免役
    CRIT,
}
namespace Battle
{
    public class BloodWordKit : MonoBehaviour
    {
        public UILabel damageLabel;
        public Animation damageAni;
        public UILabel healLabel;
        public Animation healAni;
        public UILabel critDamageLabel;
        public Animation critAni;

        public Animation spriteAni;         // Miss Immu

        public void ShowNumber(int number)
        {
            damageLabel.gameObject.SetActive(true);
            healLabel.gameObject.SetActive(false);
            critDamageLabel.gameObject.SetActive(false);
            spriteAni.gameObject.SetActive(false);
            damageLabel.text = number.ToString();
            damageAni.Rewind();
            damageAni.Play();
        }

        public void ShowHeal(int number) {
            damageLabel.gameObject.SetActive(false);
            healLabel.gameObject.SetActive(true);
            critDamageLabel.gameObject.SetActive(false);
            spriteAni.gameObject.SetActive(false);
            healLabel.text = number.ToString();
            healAni.Rewind();
            healAni.Play();
        }

        public void ShowCrit(int number) {
            damageLabel.gameObject.SetActive(false);
            healLabel.gameObject.SetActive(false);
            critDamageLabel.gameObject.SetActive(true);
            spriteAni.gameObject.SetActive(false);
            critDamageLabel.text = number.ToString();
            critAni.Rewind();
            critAni.Play();
        }

        public void ShowMiss()
        {
            damageLabel.gameObject.SetActive(false);
            healLabel.gameObject.SetActive(false);
            critDamageLabel.gameObject.SetActive(false);
            spriteAni.gameObject.SetActive(true);
            spriteAni.GetComponent<UISprite>().spriteName = "Miss";

            spriteAni.Rewind();
            spriteAni.Play();
        }

        public void ShowImmune()
        {
            damageLabel.gameObject.SetActive(false);
            healLabel.gameObject.SetActive(false);
            critDamageLabel.gameObject.SetActive(false);
            spriteAni.gameObject.SetActive(true);
            spriteAni.GetComponent<UISprite>().spriteName = "dishurt";

            spriteAni.Rewind();
            spriteAni.Play(); ;
        }

    }
}